
export type Fview = fgui.GComponent;

export type FObject = fgui.GObject;

export type Ggraph = fgui.GGraph;

export type FButton = fgui.GButton;

export type FImage = fgui.GImage;

export type Ffactory = fgui.UIObjectFactory;

export const View = fgui.GComponent;

export const UIPackage = fgui.UIPackage;

export const GObjectPool = fgui.GObjectPool;

export const Gpath = fgui.GPath;

export const Gtween = fgui.GTween;

export const GeaseType = fgui.EaseType

export const GtweenManager = fgui.TweenManager;

export const stage = Laya.stage;


export interface UIOption {

    /**携带参数 */
    data: any;

    /**自动显示load页面（没加载资源的情况下） */
    loadView: boolean;

    /**层级 */
    layer: UILayer;

    /**背景遮罩 */
    bgMask: boolean;

    /**点击空白区域关闭,有遮罩情况下生效 */
    clickMask: boolean;

    /**为true时会先关闭当前实例，再重新打开 */
    owerwrite: boolean;

    /**依赖包资源 */
    dependencePackage: string | string[];

    /**打开成功，返回打开的页面实列 */
    openHandler: Laya.Handler;

    /**常驻界面，不会被销毁 */
    permanent: boolean;
}

export class UIInfo {
    /**唯一id */
    key: number;

    /**层级 */
    layer: number;

    /**打开时间 */
    opentime: number;

    /**关闭时间 */
    closetime: number;

    /**页面实列 */
    instance: any;

    /**页面背景遮罩 */
    viewMask: Fview;

    /**是否是常驻界面 */
    permanent: boolean;

    clear() {
        this.key = this.instance = this.viewMask = null;
    }
}

export enum Bit {
    initialize = 1,
    dispose = 1 << 1,
}

export enum UILayer {
    /**常驻层 */
    scene = 1,

    /**弹窗层 */
    dialog,

    /**top层 */
    top,

    /**特效层级 */
    eff,

    /**引导层 */
    guide,
}


